-
Notifications
You must be signed in to change notification settings - Fork 151
refactor: Add override/final keywords to virtual functions with VC6 compatibility #2101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Greptile Overview
|
| Filename | Overview |
|---|---|
| Dependencies/Utility/Utility/CppMacros.h | Added OVERRIDE and FINAL macros to provide C++11 keywords for VC6 compatibility |
| Generals/Code/GameEngine/Include/Common/Override.h | Renamed OVERRIDE template class to OverridePtr to avoid macro name conflict |
| GeneralsMD/Code/GameEngine/Include/Common/Override.h | Renamed OVERRIDE template class to OverridePtr to avoid macro name conflict |
| Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DDebrisDraw.h | Renamed AnimStateType enum values from FINAL to ANIM_FINAL to avoid macro conflict |
| GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DDebrisDraw.h | Renamed AnimStateType enum values from FINAL to ANIM_FINAL to avoid macro conflict |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant CT as clang-tidy
participant Macro as CppMacros.h
participant Template as OVERRIDE Template Class
participant Enum as AnimStateType Enum
participant Files as Virtual Functions (65 files)
Dev->>CT: Run cppcoreguidelines-explicit-virtual-functions
CT->>Files: Identify missing override keywords
CT-->>Dev: Generate fixes
Dev->>Macro: Add OVERRIDE and FINAL macros
Note over Macro: C++11: #define OVERRIDE override<br/>Pre-C++11: #define OVERRIDE (empty)
Dev->>Template: Rename OVERRIDE<T> class
Note over Template: Conflict: template name vs macro name
Template-->>Template: Rename to OverridePtr<T>
Dev->>Enum: Rename FINAL enum value
Note over Enum: Conflict: enum value vs FINAL macro
Enum-->>Enum: Rename to ANIM_FINAL
Dev->>Files: Replace "virtual" with "OVERRIDE"
Note over Files: Remove virtual keyword<br/>Add OVERRIDE macro suffix
Files-->>Dev: VC6 compatible code with override semantics
20a3b96 to
283d9e8
Compare
…o avoid macro conflict
…avoid macro conflict
283d9e8 to
999978f
Compare
Summary
Apply clang-tidy
cppcoreguidelines-explicit-virtual-functionsfixes to addoverridekeywords to virtual function overridesAdd
OVERRIDEandFINALmacros to CppMacros.h for VC6 compatibilityUse
OVERRIDEmacro instead of bareoverridekeyword in all affected filesNote had to rename a couple of things that conflicted with OVERRIDE and FINAL.